<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>解构赋值</title>
</head>

<body>
    <script>
        //对数组和对象里的元素进行修改
        const f4 = ['小红', '小绿', '小蓝'];
        let [hong, lv, lan] = f4;
        console.log(lv);   //小绿

        const stu = {
            name: 'sun',
            age: 18,
            score: 100,
            games: function () {
                console.log('写代码');
            }
        };
        let { name, age, score, games } = stu;
        games();
        console.log(games);
    </script>
</body>

</html>